<?php
/**
 * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php
 *
 * This is an application wide file to load any function that is not used within a class
 * define. You can also use this to include or require any files in your application.
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.app.config
 * @since         CakePHP(tm) v 0.10.8.2117
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

/**
 * The settings below can be used to set additional paths to models, views and controllers.
 * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
 *
 * App::build(array(
 *     'plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),
 *     'models' =>  array('/full/path/to/models/', '/next/full/path/to/models/'),
 *     'views' => array('/full/path/to/views/', '/next/full/path/to/views/'),
 *     'controllers' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'),
 *     'datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),
 *     'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
 *     'components' => array('/full/path/to/components/', '/next/full/path/to/components/'),
 *     'helpers' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'),
 *     'vendors' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),
 *     'shells' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),
 *     'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
 * ));
 *
 */

/**
 * As of 1.3, additional rules for the inflector are added below
 *
 * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
 * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
 *
 */
    
    $palavras_sem_alteracao = array('atlas', 'lapis', 'onibus', 'pires', 'virus', 'home','login','boleto', '.*x');
    
    Inflector::rules('plural', array(
        'rules' => array(

            '/^([a-zA-Z_-]*)ao$/i' => '\1oes',

            '/^([a-zA-Z_-]*)a$/i' => '\1as',
            '/^([a-zA-Z_-]*)e$/i' => '\1es',
            '/^([a-zA-Z_-]*)i$/i' => '\1is',
            '/^([a-zA-Z_-]*)o$/i' => '\1os',
            '/^([a-zA-Z_-]*)u$/i' => '\1us',

            '/^([a-zA-Z_-]*)r$/i' => '\1res',
            '/^([a-zA-Z_-]*)s$/i' => '\1ses',
            '/^([a-zA-Z_-]*)z$/i' => '\1zes',

            '/^([a-zA-Z_-]*)al$/i' => '\1ais',
            '/^([a-zA-Z_-]*)el$/i' => '\1eis',
            '/^([a-zA-Z_-]*)il$/i' => '\1is',
            '/^([a-zA-Z_-]*)ol$/i' => '\1ois',
            '/^([a-zA-Z_-]*)ul$/i' => '\1uis',

            '/^([a-zA-Z_-]*)(m|n)$/i' => '\1ns',

            '/^([a-zA-Z_-]*)$/i' => '\1s',
            '/([ti])a$/i' => '\1a'
        ), 
        
        'irregular' => array(
            'alemao' => 'alemaes',
            'enquete_votacao' => 'enquete_votacoes',
            'enquete_pergunta' => 'enquete_perguntas',
            'tipo_aviso' => 'tipo_avisos',
            'hoje_dia' => 'hoje_dias',
            'aluno_turma' => 'alunos_turma',
            'cadastro_pfisica' => 'cadastro_pfisicas',
            'calendario_escolar' => 'calendarios_escolar',
            'endereco_pfisica' => 'enderecos_pfisicas',
            'estado_civil' => 'estados_civis',
            'movimento_caixa' => 'movimentos_caixa',
            'nota_aluno' => 'notas_alunos',
            'serie' => 'series',
            'periodo_letivo' => 'periodos_letivos',
            'pessoa_fisica' => 'pessoas_fisicas',
            'registro_aula' => 'registros_aulas',
            'tabela_mensalidade' => 'tabela_mensalidades',
            'tipo_aviso' => 'tipo_avisos',
            'tipo_comunicado' => 'tipo_comunicados',
            'tipo_lancamento' => 'tipo_lancamentos',
            'tipo_ocorrencia' => 'tipo_ocorrencias',
            'artesa' => 'artesaos',
            'bencao' => 'bencaos',
            'cao' => 'caes',
            'capelao' => 'capelaes',
            'capitao' => 'capitaes',
            'chao' => 'chaos',
            'charlatao' => 'charlataes',
            'cidadao' => 'cidadaos',
            'consul' => 'consules',
            'cristao' => 'cristaos',
            'dificil' => 'dificeis',
            'escrivao' => 'escrivaes',
            'fossel,' => 'fosseis',
            'grao' => 'graos',
            'irmao' => 'irmaos',
            'mal' => 'males',
            'mao' => 'maos',
            'orfao' => 'orfaos',
            'pais' => 'paises',
            'perfil' => 'perfis',
            'pao' => 'paes',
            'projetil' => 'projeteis',
            'reptil' => 'repteis',
            'sacristao' => 'sacristaes',
            'sotao' => 'sotaos',
            'tabeliao' => 'tabeliaes',
            'email' => 'emails',
            'menu' => 'menus',
            'usuario_sigai' => 'usuario_sigais',
            'pais' => 'paises',
            'permissao' => 'permissoes',        
            'acao' => 'acoes',
            'colaborador' => 'colaboradores',
            'colaboradores' => 'colaboradores',	
            'organizacao' => 'organizacoes',
            'qualificacao' => 'qualificacoes',
            'maturidade' => 'maturidades',				
            'fator_maturidade' =>'fator_maturidades'
        ), 
        
        'uninflected' => $palavras_sem_alteracao
        )
    );
    
    /* ----------------------------------------------------------------- */
    
    Inflector::rules('singular', array(
        'rules' => array(        
            '/^([a-zA-Z_-]*)oes$/i' => '\1ao',
            '/^([a-zA-Z_-]*)aes$/i' => '\1ao',
            '/^([a-zA-Z_-]*)aos$/i' => '\1ao',

            '/^([a-zA-Z_-]*)res$/i' => '\1r',
            '/^([a-zA-Z_-]*)ses$/i' => '\1s',
            '/^([a-zA-Z_-]*)zes$/i' => '\1z',

            '/^([a-zA-Z_-]*)ais$/i' => '\1al',
            '/^([a-zA-Z_-]*)eis$/i' => '\1el',
            '/^([a-zA-Z_-]*)is$/i' => '\1il',
            '/^([a-zA-Z_-]*)ois$/i' => '\1ol',
            '/^([a-zA-Z_-]*)uis$/i' => '\1ul',

            '/^([a-zA-Z_-]*)as$/i' => '\1a',
            '/^([a-zA-Z_-]*)es$/i' => '\1e',
            '/^([a-zA-Z_-]*)is$/i' => '\1i',
            '/^([a-zA-Z_-]*)os$/i' => '\1o',
            '/^([a-zA-Z_-]*)us$/i' => '\1u',

            '/^([a-zA-Z_-]*)ns$/i' => '\1m',

            '/^([a-zA-Z_-]*)s$/i' => '\1',
            '/([ti])a$/i' => '\1a'), 
        
        'irregular' => array(
            'abdomens' => 'abdomen',
            'germens' => 'germen',
            'hifens' => 'hifen',
            'liquens' => 'liquen'), 
        
        'uninflected' => $palavras_sem_alteracao
        )
    );


